import {remark} from '@prisma/client';
import {Length} from "class-validator";
import {ApiProperty} from "@nestjs/swagger";
import {companyEntity} from "../../company/entities/company.entity";
import {Exclude} from "class-transformer";
export class reMarkEntity implements remark{
    constructor({company, ...data }: Partial<reMarkEntity>) {
        Object.assign(this, data);
        if(company){
            this.company = new companyEntity(company);
        }
    }
    @ApiProperty()
    companyId: string;
    @ApiProperty()
    @Exclude()
    createdAt: Date;
    @ApiProperty()
    @Exclude()
    id: string;
    @Length(1,5)
    @ApiProperty()
    mark: number;
    @ApiProperty()
    @Exclude()
    updatedAt: Date;
    @ApiProperty({ required: true, type: companyEntity })
    company?: companyEntity;
}


